package com.chanjiedata.changbs.adapter;

import android.content.Context;
import android.graphics.Color;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chanjiedata.changbs.R;
import com.chanjiedata.changbs.proto.Recharge;

import java.util.List;

/**
 * 文件名 : ProgressAdapter
 * 创建者 : MangoWang
 * 创建日期 : 2019/11/25 11:50
 * 微信 : MangoWaWang
 * 邮箱 : 763482205@qq.com
 * 描述 : TODO
 */

public class EarningDetailAdapter extends BaseQuickAdapter<Recharge.Earnings_detail_list.Earnings_detail_array_list,BaseViewHolder> {
    public EarningDetailAdapter(Context context, List<Recharge.Earnings_detail_list.Earnings_detail_array_list> dataList) {
        super(R.layout.item_earing_detail,dataList);
    }

    @Override
    protected void convert(BaseViewHolder helper, Recharge.Earnings_detail_list.Earnings_detail_array_list item) {
        helper.setText(R.id.tv_title,item.getLgType())
                .setText(R.id.tv_message,item.getLgDesc())
                .setText(R.id.tv_money,item.getLgAvAmount())
                .setText(R.id.tv_time,item.getLgAddtime());

        if (item.getLgAvAmount().contains("+"))
        {
            helper.setTextColor(R.id.tv_money, Color.parseColor("#F44336"));
        }else
        {
            helper.setTextColor(R.id.tv_money,Color.parseColor("#4CAF50"));
        }

    }
}